<?php

session_start();

// Include
include_once('class/class.SmartyEngine.php');
include_once('class/class.MailEngine.php');
include_once('class/class.Utilities.php');
include_once('class/class.Validation.php');
include_once('class/class.Entity.php');
include_once('class/class.Message.php');
include_once('class/class.Contacto.php');

// Para establecer locale en espanol (evita problemas como el formateo de la fecha de Smarty)
setlocale (LC_TIME,"spanish");

// Creacion de Smarty
$smarty = SmartyEngine::getSmarty();

// Setear current URL
$smarty->assign("currentUrl",urlencode(Utilities::curPageURL()));

// Allow php tags
$smarty->allow_php_tag = true;  

// Obtener language de la session, y sino del browser
$lang = (!Validation::isEmptyString($_SESSION['lang'])) ? $_SESSION['lang'] : substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);  
$smarty->assign("lang",$lang);

//error_reporting(0);